package com.ytjj.qmyx.mall.enums;

import lombok.Getter;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;
import java.util.Map;

/**
 *
 * @version 1.0
 *
 * 订单状态
 */
@Getter
public enum OrdersStatusTypeEnums {

    OBLIGATION(0,"OBLIGATION"),
    UNSHIPPED(1,"DELIVEREDING"),//已出库
    SHIPPED(2,"DELIVERY"),
    COMPLETED(3,"COMPLETE"),
    CLOSED(4,"CANCEL"),//已取消
    LOSE_EFFICACY(5,"CANCEL"),
    REFUND(6,"REFUND");

    private int code;

    private String msg;

    OrdersStatusTypeEnums(int code,String msg){
        this.code = code;
        this.msg = msg;
    }


    public static String getType(int code) {
        OrdersStatusTypeEnums[] values = OrdersStatusTypeEnums.values();
        for(OrdersStatusTypeEnums enums : values){
            if(enums.getCode() == code){
                return enums.getMsg();
            }
        }
        return null;
    }
}
